using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableShippingMethod
	{
		public const string Table = "ShippingMethod";
		public const string ShippingMethodID = "ShippingMethodID";
		public const string ShippingMethodName = "ShippingMethodName";
		public const string IsEnable = "IsEnable";
		public const string Sort = "Sort";
		public const string ShippingCharge = "ShippingCharge";
	}
	
	[Serializable]
	public class BaseShippingMethod
		: IDbSessionEntity, IJsonClass
	{
		int m_ShippingMethodID;
		/// <summary>
        /// 
        /// </summary>
        public int ShippingMethodID
        {
            get { return m_ShippingMethodID; }
            set { m_ShippingMethodID = value; }
        }
		
		string m_ShippingMethodName;
		/// <summary>
        /// 
        /// </summary>
        public string ShippingMethodName
        {
            get { return m_ShippingMethodName; }
            set { m_ShippingMethodName = value; }
        }
		
		int m_IsEnable;
		/// <summary>
        /// 
        /// </summary>
        public int IsEnable
        {
            get { return m_IsEnable; }
            set { m_IsEnable = value; }
        }
		
		int? m_Sort;
		/// <summary>
        /// 
        /// </summary>
        public int? Sort
        {
            get { return m_Sort; }
            set { m_Sort = value; }
        }
		
		decimal? m_ShippingCharge;
		/// <summary>
        /// 
        /// </summary>
        public decimal? ShippingCharge
        {
            get { return m_ShippingCharge; }
            set { m_ShippingCharge = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_ShippingMethodID = reader[TableShippingMethod.ShippingMethodID];
            m_ShippingMethodName = reader[TableShippingMethod.ShippingMethodName];
            m_IsEnable = reader[TableShippingMethod.IsEnable];
            m_Sort = reader[TableShippingMethod.Sort];
            m_ShippingCharge = reader[TableShippingMethod.ShippingCharge];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableShippingMethod.ShippingMethodID, PrimaryKeyType.Identity, ShippingMethodID);
			writer[TableShippingMethod.ShippingMethodName] = ShippingMethodName;
			writer[TableShippingMethod.IsEnable] = IsEnable;
			writer[TableShippingMethod.Sort] = Sort;
			writer[TableShippingMethod.ShippingCharge] = ShippingCharge;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_ShippingMethodID = idd;
        }
		
		public string TableName
        {
            get { return TableShippingMethod.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_ShippingMethodID = hashToRead["ShippingMethodID"];
			 
             m_ShippingMethodName = hashToRead["ShippingMethodName"];
			 
             m_IsEnable = hashToRead["IsEnable"];
			 
             m_Sort = hashToRead["Sort"];
			 
             m_ShippingCharge = hashToRead["ShippingCharge"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["ShippingMethodID"] = ShippingMethodID;
			 
            hashToFill["ShippingMethodName"] = ShippingMethodName;
			 
            hashToFill["IsEnable"] = IsEnable;
			 
            hashToFill["Sort"] = Sort;
			 
            hashToFill["ShippingCharge"] = ShippingCharge;
			 
        }

        #endregion
		
	}
}
